--- title: Advanced Usage metaTitle: Advanced Usage description: Access Authenticator UI component state outside of the UI component supportedFrameworks: react|angular|vue|react-native --- import { useRouter } from 'next/router'; import { Tabs, TabItem, Table, TableHead, TableRow, TableCell, TableBody, View } from '@aws-amplify/ui-react'; import { Fragment } from '@/components/Fragment'; import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; import { ResponsiveTable, ResponsiveTableCell } from '@/components/ResponsiveTable'; export async function getStaticPaths() { return getCustomStaticPath(frontmatter.supportedFrameworks); } {/* `getStaticProps` is required to prevent "Error: getStaticPaths was added without a getStaticProps. Without getStaticProps, getStaticPaths does nothing" */} export async function getStaticProps() { return { props: {} } } {({ platform }) => import(`./useAuthenticator.${platform}.mdx`)} ## Access Auth State {({ platform }) => import(`./current-route.${platform}.mdx`)} ## Access Authenticated User {({ platform }) => import(`./current-user.${platform}.mdx`)} ## Trigger Transitions {({ platform }) => import(`./trigger-transitions.${platform}.mdx`)} ### Example Here's an example that uses the `toResetPassword` trigger transition, to create a custom button. Note that example uses the [Footer "slot" override](../authenticator/customization#headers--footers). {({ platform }) => import(`./example.${platform}.mdx`)} ## Full API {({ platform }) => import(`./full-api.${platform}.mdx`)} These are `readonly` contexts that represent the current auth state. Any unapplicable `context` will be `undefined`. Name Description Type `user` Current signed in user `AmplifyUser` `route` Name of the auth flow user is in `string` `error` Any error returned from service API call `string` `validationErrors` Any form validation errors found. Maps each error message to respective input name. `Record` `hasValidationErrors` Whether there are any form validation errors `boolean` `isPending` Whether service API call is in progress `boolean` `codeDeliveryDetail` Provides detail on where confirm sign up code is sent to. `CodeDeliveryDetail` These helper functions trigger transition to another `route`. Note that any invalid transition (e.g. `sign-in` to `authenticated` directly) will be no-op. Name Description Type `toSignIn` Transitions to `signIn`. Allowed from `signUp`, `confirmSignUp`, `confirmSignIn`, `setupTOTP`, `resetPassword`, and `confirmResetPassword` `() => void` `toSignUp` Transitions to `signUp`. Allowed from `signIn`. `() => void` `toResetPassword` Transitions to `resetPassword`. Allowed from `signIn`. `() => void` {({ platform }) => platform === 'angular' || platform === 'vue' ? import(`./to-federated-sign-in.mdx`) : Promise.resolve(() => null)} `skipVerification` Skips verification process. Allowed from `verifyUser` and `confirmVerifyUser` `() => void`